centos 7安裝redis 改port

前言

正文

最簡單地安裝方式,

yum install redis
  1. 編輯 /etc/redis.conf
    找到 port 6379 ,將它改為 port 8090

  2. 重啟服務 sudo systemctl restart redis

  3. 發現服務無法啟動(fig.1),查log(fig.2),發現沒有權限。

[[33.fig-1.jpg]]

[[33.fig-2.jpg]]

  1. selinux的問題,要麻關掉,要麻新增port
sudo: semanage: command not found

安裝
yum install policycoreutils-python

然後執行

sudo semanage port -a -t redis_port_t -p tcp 8090

ref.
Redis: Creating Server TCP listening socket *:6388: bind: Permission denied
解決 semanage command not found

  1. 重開redis。
sudo systemctl restart redis
sudo systemctl status redis

ref.
安裝 Redis 時遇到的錯誤排除